/**
 * @file shoppingCart.js
 * @author hj
 * @date 2016-11-17
 */
import Vue from 'vue';
import App from 'src/app';
import Router from 'vue-router';

/* 加载样式 */
require('./we.css');

/* 加载页面 */
import we from './vue/we.vue';
import message from './vue/message.vue';
import address from './vue/address.vue';
import addressEdit from './vue/addressEdit.vue';
import addAddress from './vue/addAddress.vue';
import orderType from './vue/orderType.vue';
import orderList from './vue/orderList.vue';
import compile from './vue/compile.vue';
import integral from './vue/integral.vue';

Vue.use(Router);

var router = new Router();
router.map({
  '/': {
    component: we
  },
  '/message': {
    component: message
  },
  '/address/:id': {
    name: 'address',
    component: address
  },
  '/orderList': {
    name: 'orderList',
    component: orderList
  },
  '/orderType/:id': {
    name: 'orderType',
    component: orderType
  },
  '/compile': {
    component: compile
  },
  '/integral': {
    component: integral
  },
  '/addressEdit/:id': {
    name: 'addressEdit',
    component: addressEdit
  },
  '/addAddress': {
    name: 'addAddress',
    component: addAddress
  }
});
router.beforeEach(function () {
  window.scrollTo(0, 0);
});
router.redirect({
  '*': '/'
});
router.start(App, 'html');
